#pragma once

struct SCRRect
{
	SCRRect();
	SCRRect(const int& X, const int& Y, const int& Width, const int& Height);
	bool Intersect(const int& X, const int& Y) const;
	bool Intersect(const SCRRect& Rect) const;

	int m_X;
	int m_Y;
	int m_Width;
	int m_Height;
};

inline SCRRect::SCRRect()
	: m_X(0)
	, m_Y(0)
	, m_Width(0)
	, m_Height(0)
{
}

inline SCRRect::SCRRect(const int& X, const int& Y, const int& Width, const int& Height)
	: m_X(X)
	, m_Y(Y)
	, m_Width(Width)
	, m_Height(Height)
{
}

inline bool SCRRect::Intersect(const int& X, const int& Y) const
{
	return !(X < m_X || Y < m_Y || X > m_X + m_Width || Y > m_Y + m_Height); 
}

inline bool SCRRect::Intersect(const SCRRect& Rect) const
{
	return !(Rect.m_X > m_X + m_Width ||
			 Rect.m_X + Rect.m_Width < m_X ||
			 Rect.m_Y > m_Y + m_Height ||
			 Rect.m_Y + Rect.m_Height < m_Y);
}
